//
//  GFCalculateWidthOrHeigth.m
//  GoodFood
//
//  Created by dllo on 15/11/5.
//  Copyright © 2015年 荣伟峰. All rights reserved.
//

#import "GFCalculateWidthOrHeigth.h"

@implementation GFCalculateWidthOrHeigth

+ (CGFloat)stringHeight:(NSString *)text withWidth:(NSInteger)wNumber withFontDictionary:(NSDictionary *)fontDic {
    CGRect rect = [text boundingRectWithSize:CGSizeMake(wNumber, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:fontDic context:nil];
    return rect.size.height + 1;
}

+ (CGFloat)stringWidth:(NSString *)text withHeigth:(NSInteger)hNumber withFontDictionary:(NSDictionary *)fontDic {
    CGRect rect = [text boundingRectWithSize:CGSizeMake(0, hNumber) options:NSStringDrawingUsesLineFragmentOrigin attributes:fontDic context:nil];
    return rect.size.width + 1;
}
@end
